using System;
using UnityEngine;

public class CityBuildingDecorationHandler : MonoBehaviour
{
	public CityBuildingElementData Data;

	private void Awake()
	{
		if (!Data.Unlocked)
		{
			base.gameObject.SetActive(value: false);
			CityBuildingElementData data = Data;
			data.OnUnlock = (Action)Delegate.Combine(data.OnUnlock, new Action(Show));
		}
	}

	private void OnDestroy()
	{
		CityBuildingElementData data = Data;
		data.OnUnlock = (Action)Delegate.Remove(data.OnUnlock, new Action(Show));
	}

	private void Show()
	{
		base.gameObject.SetActive(value: true);
	}
}
